<template>
	<view class="box" @click="onClick" :style="{background:color}">
		{{num}}
	</view>
	<switch  @change="onChange"></switch>
	<button :loading="isLoading" type="primary">普通按钮</button>
</template>

<script setup>
import {ref} from "vue"
const num = ref(1)
const color = ref("#fc359a")
const isLoading = ref(false)
function onClick(){
	num.value++
	color.value = "#"+String(Math.random()).substring(3,9)
	console.log(String(Math.random()).substring(3,9))
}
	
function onChange(event){
	isLoading.value = event.detail.value
	console.log(event.detail.value)
}
</script>

<style lang="scss">
.box{
	width: 200px;
	height: 200px;
	background: orange;
}
</style>
